package com.example.userclient;


import android.os.Parcel;
import android.os.Parcelable;

public class AddBook implements Parcelable {
    private long id;
    private String self_id;
    private String bookName;
    private String authorName;
    private String isbn;
    private String picture;
    private String publisher;
    private String summary;
    private double price;
    private long createTime;
    private Position position;
    private String bookOwner;

    public AddBook(){}

    public AddBook(long id, String self_id, String bookName, String authorName, String isbn, String picture, String publisher, String summary, double price, long createTime, Position position, String bookOwner) {
        this.id = id;
        this.self_id = self_id;
        this.bookName = bookName;
        this.authorName = authorName;
        this.isbn = isbn;
        this.picture = picture;
        this.publisher = publisher;
        this.summary = summary;
        this.price = price;
        this.createTime = createTime;
        this.position = position;
        this.bookOwner = bookOwner;
    }



    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getSelf_id() {
        return self_id;
    }

    public void setSelf_id(String self_id) {
        this.self_id = self_id;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public String getIsbn() {
        return isbn;
    }

    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public Position getPosition() {
        return position;
    }

    public void setPosition(Position position) {
        this.position = position;
    }

    public String getBookOwner() {
        return bookOwner;
    }

    public void setBookOwner(String bookOwner) {
        this.bookOwner = bookOwner;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(this.id);
        dest.writeString(this.self_id);
        dest.writeString(this.bookName);
        dest.writeString(this.authorName);
        dest.writeString(this.isbn);
        dest.writeString(this.picture);
        dest.writeString(this.publisher);
        dest.writeString(this.summary);
        dest.writeDouble(this.price);
        dest.writeLong(this.createTime);
        dest.writeParcelable(this.position, flags);
        dest.writeString(this.bookOwner);
    }

    public void readFromParcel(Parcel source) {
        this.id = source.readLong();
        this.self_id = source.readString();
        this.bookName = source.readString();
        this.authorName = source.readString();
        this.isbn = source.readString();
        this.picture = source.readString();
        this.publisher = source.readString();
        this.summary = source.readString();
        this.price = source.readDouble();
        this.createTime = source.readLong();
        this.position = source.readParcelable(Position.class.getClassLoader());
        this.bookOwner = source.readString();
    }

    protected AddBook(Parcel in) {
        this.id = in.readLong();
        this.self_id = in.readString();
        this.bookName = in.readString();
        this.authorName = in.readString();
        this.isbn = in.readString();
        this.picture = in.readString();
        this.publisher = in.readString();
        this.summary = in.readString();
        this.price = in.readDouble();
        this.createTime = in.readLong();
        this.position = in.readParcelable(Position.class.getClassLoader());
        this.bookOwner = in.readString();
    }

    public static final Parcelable.Creator<AddBook> CREATOR = new Parcelable.Creator<AddBook>() {
        @Override
        public AddBook createFromParcel(Parcel source) {
            return new AddBook(source);
        }

        @Override
        public AddBook[] newArray(int size) {
            return new AddBook[size];
        }
    };
}
